//
// Created by 抑~风 on 2023-02-13.
//
#include <iostream>
#include <vector>
using namespace std;

class Solution {
public:
    using LL= long long ;
    int divide(int x, int y) {
        vector<LL> exp;
        bool is_munis = false;
        if(x<0 && y>0 || x>0 && y<0)    is_munis = true;
        for(int i=y;i <= x;i = i+i)    {
            cout<<i<<" "<<i+i<<" "<<x<<endl;
            exp.push_back(i);

            cout<<"==="<<i<<endl;
        }
        x = abs(x),y = abs(y);
        LL res = 0;
        for(int i=exp.size()-1;i>=0;i--){
            if(exp[i] > x)  res += exp[i],x-=exp[i];
        }
        if(is_munis)    res *= -1;
        if(res > INT_MAX)   return INT_MAX;
        else if(res < INT_MIN)  return INT_MIN;
        else return res;

    }
};

int main(){
    Solution s;
    cout<<s.divide(10,3)<<endl;
}
